package br.com.games.pyx.atores.game;

import org.anddev.andengine.entity.primitive.Rectangle;
import org.anddev.andengine.entity.shape.IShape;
import org.anddev.andengine.entity.sprite.AnimatedSprite;
import org.anddev.andengine.extension.physics.box2d.PhysicsWorld;

import br.com.games.pyx.atores.Ator;
import br.com.games.pyx.singleton.FabricaRecursos;

public class Toupety extends Ator {

	public enum Animacao {
		ANDANDO_DIR,
		ANDANDO_ESQ
	};
	
//	private Rectangle shape;
	
	public Toupety() {
	}
	
	
	@Override
	protected void create() {
				
		AnimatedSprite andandoDir = FabricaRecursos.get().getAnimatedSprite(FabricaRecursos.get().
				getTiledTextureRegion("imagens/toupety/toupety_andando_dir.png", 0, 0, 7, 1, false, 1024, 2048),
				0,0,80);
		AnimatedSprite andandoEsq = FabricaRecursos.get().getAnimatedSprite(FabricaRecursos.get().
				getTiledTextureRegion("imagens/toupety/toupety_andando_dir.png", 0, 0, 7, 1, true, 1024, 2048),
				0,0,80);
		
		this.addAnimation(Animacao.ANDANDO_DIR.ordinal(), andandoDir);
		this.addAnimation(Animacao.ANDANDO_ESQ.ordinal(), andandoEsq);
	}


	@Override
	public void registerBody(PhysicsWorld world) {		
		registerBody(world, 1, 0.5f, 0.5f, true, false);
	}


	@Override
	protected IShape initShape() {
		return new Rectangle(0, 0, 50, 52);
	}

}
